# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AndroidPublisher.V3.Model.AppRecoveryAction do
  @moduledoc """
  Information about an app recovery action.

  ## Attributes

  *   `appRecoveryId` (*type:* `String.t`, *default:* `nil`) - ID corresponding to the app recovery action.
  *   `cancelTime` (*type:* `DateTime.t`, *default:* `nil`) - Timestamp of when the app recovery action is canceled by the developer. Only set if the recovery action has been canceled.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Timestamp of when the app recovery action is created by the developer. It is always set after creation of the recovery action.
  *   `deployTime` (*type:* `DateTime.t`, *default:* `nil`) - Timestamp of when the app recovery action is deployed to the users. Only set if the recovery action has been deployed.
  *   `lastUpdateTime` (*type:* `DateTime.t`, *default:* `nil`) - Timestamp of when the developer last updated recovery action. In case the action is cancelled, it corresponds to cancellation time. It is always set after creation of the recovery action.
  *   `remoteInAppUpdateData` (*type:* `GoogleApi.AndroidPublisher.V3.Model.RemoteInAppUpdateData.t`, *default:* `nil`) - Data about the remote in-app update action such as such as recovered user base, recoverable user base etc. Set only if the recovery action type is Remote In-App Update.
  *   `status` (*type:* `String.t`, *default:* `nil`) - The status of the recovery action.
  *   `targeting` (*type:* `GoogleApi.AndroidPublisher.V3.Model.Targeting.t`, *default:* `nil`) - Specifies targeting criteria for the recovery action such as regions, android sdk versions, app versions etc.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :appRecoveryId => String.t() | nil,
          :cancelTime => DateTime.t() | nil,
          :createTime => DateTime.t() | nil,
          :deployTime => DateTime.t() | nil,
          :lastUpdateTime => DateTime.t() | nil,
          :remoteInAppUpdateData =>
            GoogleApi.AndroidPublisher.V3.Model.RemoteInAppUpdateData.t() | nil,
          :status => String.t() | nil,
          :targeting => GoogleApi.AndroidPublisher.V3.Model.Targeting.t() | nil
        }

  field(:appRecoveryId)
  field(:cancelTime, as: DateTime)
  field(:createTime, as: DateTime)
  field(:deployTime, as: DateTime)
  field(:lastUpdateTime, as: DateTime)
  field(:remoteInAppUpdateData, as: GoogleApi.AndroidPublisher.V3.Model.RemoteInAppUpdateData)
  field(:status)
  field(:targeting, as: GoogleApi.AndroidPublisher.V3.Model.Targeting)
end

defimpl Poison.Decoder, for: GoogleApi.AndroidPublisher.V3.Model.AppRecoveryAction do
  def decode(value, options) do
    GoogleApi.AndroidPublisher.V3.Model.AppRecoveryAction.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AndroidPublisher.V3.Model.AppRecoveryAction do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
